<template>
  <div class="dashboard-container">
    <div class="app-container">
      <el-card shadow="never">
        <!-- 详情数据 -->
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="企业信息" name="first">
            <el-form ref="form" :model="formData" label-width="200px">
              <el-form-item label="企业名称">
                <el-input v-model="formData.name" disabled style="width:250px"></el-input>
              </el-form-item>
              <el-form-item label="企业地址">
                <el-input v-model="formData.companyAddress" disabled style="width:250px"></el-input>
              </el-form-item>
              <el-form-item label="企业电话">
                <el-input v-model="formData.companyPhone" disabled style="width:250px"></el-input>
              </el-form-item>
              <el-form-item label="企业电话">
                <el-input v-model="formData.mailbox" disabled style="width:250px"></el-input>
              </el-form-item>
            </el-form>
          </el-tab-pane>
          <el-tab-pane label="账户信息" name="second">账户信息</el-tab-pane>
          <el-tab-pane label="交易记录" name="third">交易记录</el-tab-pane>
        </el-tabs>
        <!-- end -->
      </el-card>
    </div>
  </div>
</template>

<script>
import { detail } from "@/api/base/saasClients";
export default {
  name: "saas-clients-detail",
  data() {
    return {
      activeName: "first",
      formData: {}
    };
  },
  methods: {
    // 获取列表数据
    getDetail(id) {
      //调用api发起请求
      detail({ id }).then(res => {
        this.formData = res.data.data;
        console.log(this.formData);
      });
    },
    handleClick() {}
  },
  // 创建完毕状态
  created() {
    //从router中获取url中的id
    console.log(this.$route);
    let companyId = this.$route.params.id;
    console.log(companyId);
    this.getDetail(companyId);
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.alert {
  margin: 10px 0px 0px 0px;
}
.pagination {
  margin-top: 10px;
  text-align: right;
}
</style>
